﻿Imports System.ComponentModel

Public Class ACVehiculo

#Region " Variables "
   Private m_colorall As System.Drawing.Color = Color.Black
   Private m_colordefaultone As System.Drawing.Color = Color.Black
   Private m_colordefaulttwo As System.Drawing.Color = Color.Red
   Private m_tamano As Tamanho = Tamanho.Small


   Enum Neumatico
      IzqDelExtPos1
      DerDelExtPos1
      IzqPosExtPos2
      IzqPosIntPos2
      DerPosIntPos2
      DerPosExtPos2
      IzqPosExtPos3
      IzqPosIntPos3
      DerPosIntPos3
      DerPosExtPos3
      IzqPosExtPos4
      IzqPosIntPos4
      DerPosIntPos4
      DerPosExtPos4
   End Enum

   Enum Tamanho
      Small
      Big
   End Enum
#End Region

#Region " Propiedades "

   <Category("AcerosComerciales"), _
   DefaultValue(Tamanho.Small), _
   Localizable(True), _
   Description("Define el Tamaño del control.")> _
   Public Property Tamaño() As Tamanho
      Get
         Return m_tamano
      End Get
      Set(ByVal value As Tamanho)
         m_tamano = value
         setTamanho(m_tamano)
      End Set
   End Property

#Region " Delanteros "
   Public Property NeuDelIzqExt1() As System.Drawing.Color
      Get
         Return rsDIE1.BackColor
      End Get
      Set(ByVal value As System.Drawing.Color)
         rsDIE1.BackColor = value
         rsDIE1.BorderColor = value
      End Set
   End Property

   Public Property NeuDelDerExt1() As System.Drawing.Color
      Get
         Return rsDDE1.BackColor
      End Get
      Set(ByVal value As System.Drawing.Color)
         rsDDE1.BackColor = value
         rsDDE1.BorderColor = value
      End Set
   End Property
#End Region

#Region "Posteriores"
#Region " Fila 2"
   Public Property NeuPosIzqExt2() As System.Drawing.Color
      Get
         Return rsPIE2.BackColor
      End Get
      Set(ByVal value As System.Drawing.Color)
         rsPIE2.BackColor = value
         rsPIE2.BorderColor = value
      End Set
   End Property

   Public Property NeuPosIzqInt2() As System.Drawing.Color
      Get
         Return rsPII2.BackColor
      End Get
      Set(ByVal value As System.Drawing.Color)
         rsPII2.BackColor = value
         rsPII2.BorderColor = value
      End Set
   End Property

   Public Property NeuPosDerExt2() As System.Drawing.Color
      Get
         Return rsPDE2.BackColor
      End Get
      Set(ByVal value As System.Drawing.Color)
         rsPDE2.BackColor = value
         rsPDE2.BorderColor = value
      End Set
   End Property

   Public Property NeuPosDerInt2() As System.Drawing.Color
      Get
         Return rsPDI2.BackColor
      End Get
      Set(ByVal value As System.Drawing.Color)
         rsPDI2.BackColor = value
         rsPDI2.BorderColor = value
      End Set
   End Property
#End Region

#Region " Fila 3"
   Public Property NeuPosIzqExt3() As System.Drawing.Color
      Get
         Return rsPIE3.BackColor
      End Get
      Set(ByVal value As System.Drawing.Color)
         rsPIE3.BackColor = value
         rsPIE3.BorderColor = value
      End Set
   End Property

   Public Property NeuPosIzqInt3() As System.Drawing.Color
      Get
         Return rsPII3.BackColor
      End Get
      Set(ByVal value As System.Drawing.Color)
         rsPII3.BackColor = value
         rsPII3.BorderColor = value
      End Set
   End Property

   Public Property NeuPosDerExt3() As System.Drawing.Color
      Get
         Return rsPDE3.BackColor
      End Get
      Set(ByVal value As System.Drawing.Color)
         rsPDE3.BackColor = value
         rsPDE3.BorderColor = value
      End Set
   End Property

   Public Property NeuPosDerInt3() As System.Drawing.Color
      Get
         Return rsPDI3.BackColor
      End Get
      Set(ByVal value As System.Drawing.Color)
         rsPDI3.BackColor = value
         rsPDI3.BorderColor = value
      End Set
   End Property
#End Region

#Region " Fila 4"
   Public Property NeuPosIzqExt4() As System.Drawing.Color
      Get
         Return rsPIE4.BackColor
      End Get
      Set(ByVal value As System.Drawing.Color)
         rsPIE4.BackColor = value
         rsPIE4.BorderColor = value
      End Set
   End Property

   Public Property NeuPosIzqInt4() As System.Drawing.Color
      Get
         Return rsPII4.BackColor
      End Get
      Set(ByVal value As System.Drawing.Color)
         rsPII4.BackColor = value
         rsPII4.BorderColor = value
      End Set
   End Property

   Public Property NeuPosDerExt4() As System.Drawing.Color
      Get
         Return rsPDE4.BackColor
      End Get
      Set(ByVal value As System.Drawing.Color)
         rsPDE4.BackColor = value
         rsPDE4.BorderColor = value
      End Set
   End Property

   Public Property NeuPosDerInt4() As System.Drawing.Color
      Get
         Return rsPDI4.BackColor
      End Get
      Set(ByVal value As System.Drawing.Color)
         rsPDI4.BackColor = value
         rsPDI4.BorderColor = value
      End Set
   End Property
#End Region
#End Region

   <Category("AcerosComerciales"), _
   DefaultValue(True), _
   Localizable(True), _
   Description("Define el La visibilidad de los Neumaticos Posicion 1.")> _
   Public Property VisiblePanelPos1() As Boolean
      Get
         Return pnlPos1.Visible
      End Get
      Set(ByVal value As Boolean)
         pnlPos1.Visible = value
      End Set
   End Property

   <Category("AcerosComerciales"), _
   DefaultValue(True), _
   Localizable(True), _
   Description("Define el La visibilidad de los Neumaticos Posicion 3.")> _
   Public Property VisiblePanelPos3() As Boolean
      Get
         Return pnlPos3.Visible
      End Get
      Set(ByVal value As Boolean)
         pnlPos3.Visible = value
      End Set
   End Property

   <Category("AcerosComerciales"), _
   DefaultValue(True), _
   Localizable(True), _
   Description("Define el La visibilidad de los Neumaticos Posicion 4.")> _
   Public Property VisiblePanelPos4() As Boolean
      Get
         Return pnlPos4.Visible
      End Get
      Set(ByVal value As Boolean)
         pnlPos4.Visible = value
      End Set
   End Property

   Public Property ColorAll() As System.Drawing.Color
      Get
         Return m_colorall
      End Get
      Set(ByVal value As System.Drawing.Color)
         m_colorall = value
         m_colordefaultone = value
         setColorAll(value)
      End Set
   End Property

   Public Property ColorDefaultOne() As System.Drawing.Color
      Get
         Return m_colordefaultone
      End Get
      Set(ByVal value As System.Drawing.Color)
         m_colordefaultone = value
      End Set
   End Property

   Public Property ColorDefaultTwo() As System.Drawing.Color
      Get
         Return m_colordefaulttwo
      End Get
      Set(ByVal value As System.Drawing.Color)
         m_colordefaulttwo = value
      End Set
   End Property


#End Region

#Region " Constructores "

#End Region

#Region " Metodos "
   Public Sub setColorAll(ByVal x_color As System.Drawing.Color)
      Try
         rsDIE1.BackColor = x_color
         rsDDE1.BackColor = x_color

         rsPIE2.BackColor = x_color
         rsPII2.BackColor = x_color
         rsPDE2.BackColor = x_color
         rsPDI2.BackColor = x_color

         rsPIE3.BackColor = x_color
         rsPII3.BackColor = x_color
         rsPDE3.BackColor = x_color
         rsPDI3.BackColor = x_color

         rsPIE4.BackColor = x_color
         rsPII4.BackColor = x_color
         rsPDE4.BackColor = x_color
         rsPDI4.BackColor = x_color

         rsDIE1.BorderColor = x_color
         rsDDE1.BorderColor = x_color

         rsPIE2.BorderColor = x_color
         rsPII2.BorderColor = x_color
         rsPDE2.BorderColor = x_color
         rsPDI2.BorderColor = x_color

         rsPIE3.BorderColor = x_color
         rsPII3.BorderColor = x_color
         rsPDE3.BorderColor = x_color
         rsPDI3.BorderColor = x_color

         rsPIE4.BorderColor = x_color
         rsPII4.BorderColor = x_color
         rsPDE4.BorderColor = x_color
         rsPDI4.BorderColor = x_color
      Catch ex As Exception
         Throw ex
      End Try
   End Sub

   Public Sub setColor(ByVal x_neumatico As String)
      Try
         setColor(x_neumatico, m_colordefaulttwo)
      Catch ex As Exception
         Throw ex
      End Try
   End Sub

   Public Sub setColor(ByVal x_neumatico As String, ByVal x_color As System.Drawing.Color)
      Try
         setColorAll(m_colordefaultone)
         Select Case x_neumatico
            Case "DIE1"
               rsDIE1.BackColor = x_color
               rsDIE1.BorderColor = x_color
            Case "DDE1"
               rsDDE1.BackColor = x_color
               rsDDE1.BorderColor = x_color
            Case "PIE2"
               rsPIE2.BackColor = x_color
               rsPIE2.BorderColor = x_color
            Case "PII2"
               rsPII2.BackColor = x_color
               rsPII2.BorderColor = x_color
            Case "PDE2"
               rsPDE2.BackColor = x_color
               rsPDE2.BorderColor = x_color
            Case "PDI2"
               rsPDI2.BackColor = x_color
               rsPDI2.BorderColor = x_color
            Case "PIE3"
               rsPIE3.BackColor = x_color
               rsPIE3.BorderColor = x_color
            Case "PII3"
               rsPII3.BackColor = x_color
               rsPII3.BorderColor = x_color
            Case "PDE3"
               rsPDE3.BackColor = x_color
               rsPDE3.BorderColor = x_color
            Case "PDI3"
               rsPDI3.BackColor = x_color
               rsPDI3.BorderColor = x_color
            Case "PIE4"
               rsPIE4.BackColor = x_color
               rsPIE4.BorderColor = x_color
            Case "PII4"
               rsPII4.BackColor = x_color
               rsPII4.BorderColor = x_color
            Case "PDE4"
               rsPDE4.BackColor = x_color
               rsPDE4.BorderColor = x_color
            Case "PDI4"
               rsPDI4.BackColor = x_color
               rsPDI4.BorderColor = x_color
            Case Else

         End Select
      Catch ex As Exception
         Throw ex
      End Try
   End Sub

   Private Sub setTamanho(ByVal x_tipo As Tamanho)
      Try
         Me.pnlVehiculo.SuspendLayout()
         Me.pnlPos4.SuspendLayout()
         Me.pnlPos3.SuspendLayout()
         Me.pnlPos2.SuspendLayout()
         Me.pnlPos1.SuspendLayout()
         Me.SuspendLayout()

         Select Case x_tipo
            Case Tamanho.Small

               '' Line /*****************************************************************/
               Me.LineShape1.X1 = 8
               Me.LineShape1.X2 = 33
               Me.LineShape1.Y1 = 11
               Me.LineShape1.Y2 = 11
               Me.LineShape1.BorderWidth = 1

               Me.LineShape2.X1 = 10
               Me.LineShape2.X2 = 35
               Me.LineShape2.Y1 = 10
               Me.LineShape2.Y2 = 10
               Me.LineShape2.BorderWidth = 1

               Me.LineShape3.X1 = 10
               Me.LineShape3.X2 = 35
               Me.LineShape3.Y1 = 11
               Me.LineShape3.Y2 = 11
               Me.LineShape3.BorderWidth = 1

               Me.LineShape4.X1 = 10
               Me.LineShape4.X2 = 35
               Me.LineShape4.Y1 = 11
               Me.LineShape4.Y2 = 11
               Me.LineShape4.BorderWidth = 1

               '' 1 /*****************************************************************/
               Me.pnlPos1.Location = New System.Drawing.Point(4, 3)
               Me.pnlPos1.Size = New System.Drawing.Size(45, 21)

               Me.rsDDE1.Location = New System.Drawing.Point(33, 4)
               Me.rsDDE1.Size = New System.Drawing.Size(5, 13)

               Me.rsDIE1.Location = New System.Drawing.Point(4, 4)
               Me.rsDIE1.Size = New System.Drawing.Size(5, 13)

               Me.ShapeContainer13.Size = New System.Drawing.Size(45, 21)

               '' 2 /*****************************************************************/
               Me.pnlPos2.Location = New System.Drawing.Point(4, 39)
               Me.pnlPos2.Size = New System.Drawing.Size(45, 22)

               Me.rsPII2.Location = New System.Drawing.Point(12, 4)
               Me.rsPII2.Size = New System.Drawing.Size(5, 13)

               Me.rsPDE2.Location = New System.Drawing.Point(33, 4)
               Me.rsPDE2.Size = New System.Drawing.Size(5, 13)

               Me.rsPIE2.Location = New System.Drawing.Point(5, 4)
               Me.rsPIE2.Size = New System.Drawing.Size(5, 13)

               Me.rsPDI2.Location = New System.Drawing.Point(26, 4)
               Me.rsPDI2.Size = New System.Drawing.Size(5, 13)

               Me.ShapeContainer10.Size = New System.Drawing.Size(45, 22)
               '' 3 /*****************************************************************/
               Me.pnlPos3.Location = New System.Drawing.Point(4, 64)
               Me.pnlPos3.Size = New System.Drawing.Size(45, 22)

               Me.rsPII3.Location = New System.Drawing.Point(12, 4)
               Me.rsPII3.Size = New System.Drawing.Size(5, 13)

               Me.rsPDE3.Location = New System.Drawing.Point(33, 4)
               Me.rsPDE3.Size = New System.Drawing.Size(5, 13)

               Me.rsPIE3.Location = New System.Drawing.Point(5, 4)
               Me.rsPIE3.Size = New System.Drawing.Size(5, 13)

               Me.rsPDI3.Location = New System.Drawing.Point(26, 4)
               Me.rsPDI3.Size = New System.Drawing.Size(5, 13)

               Me.ShapeContainer11.Size = New System.Drawing.Size(45, 22)
               '' 4 /*****************************************************************/
               Me.pnlPos4.Location = New System.Drawing.Point(4, 87)
               Me.pnlPos4.Size = New System.Drawing.Size(45, 22)

               Me.rsPII4.Location = New System.Drawing.Point(12, 4)
               Me.rsPII4.Size = New System.Drawing.Size(5, 13)

               Me.rsPDE4.Location = New System.Drawing.Point(33, 4)
               Me.rsPDE4.Size = New System.Drawing.Size(5, 13)

               Me.rsPIE4.Location = New System.Drawing.Point(5, 4)
               Me.rsPIE4.Size = New System.Drawing.Size(5, 13)

               Me.rsPDI4.Location = New System.Drawing.Point(26, 4)
               Me.rsPDI4.Size = New System.Drawing.Size(5, 13)

               Me.ShapeContainer12.Size = New System.Drawing.Size(45, 22)

               Me.pnlVehiculo.Size = New System.Drawing.Size(52, 110)
               Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
               Me.Size = New System.Drawing.Size(52, 110)
               Me.MaximumSize = New System.Drawing.Size(52, 200)
               Me.MinimumSize = New System.Drawing.Size(52, 100)

            Case Tamanho.Big
               Me.LineShape1.X1 = 8
               Me.LineShape1.X2 = 83
               Me.LineShape1.Y1 = 22
               Me.LineShape1.Y2 = 22
               Me.LineShape1.BorderWidth = 8

               Me.LineShape2.X1 = 8
               Me.LineShape2.X2 = 83
               Me.LineShape2.Y1 = 22
               Me.LineShape2.Y2 = 22
               Me.LineShape2.BorderWidth = 7

               Me.LineShape3.X1 = 8
               Me.LineShape3.X2 = 83
               Me.LineShape3.Y1 = 22
               Me.LineShape3.Y2 = 22
               Me.LineShape3.BorderWidth = 7

               Me.LineShape4.X1 = 8
               Me.LineShape4.X2 = 83
               Me.LineShape4.Y1 = 22
               Me.LineShape4.Y2 = 22
               Me.LineShape4.BorderWidth = 7

               '' 1 /*****************************************************************/
               Me.pnlPos1.Location = New System.Drawing.Point(4, 3)
               Me.pnlPos1.Size = New System.Drawing.Size(102, 44)

               Me.rsDDE1.Location = New System.Drawing.Point(83, 4)
               Me.rsDDE1.Size = New System.Drawing.Size(15, 35)

               Me.rsDIE1.Location = New System.Drawing.Point(4, 4)
               Me.rsDIE1.Size = New System.Drawing.Size(15, 35)

               Me.ShapeContainer13.Size = New System.Drawing.Size(102, 44)
               '' 2 /*****************************************************************/
               Me.pnlPos2.Location = New System.Drawing.Point(4, 98)
               Me.pnlPos2.Size = New System.Drawing.Size(102, 44)

               Me.rsPII2.Location = New System.Drawing.Point(25, 4)
               Me.rsPII2.Size = New System.Drawing.Size(15, 35)

               Me.rsPDE2.Location = New System.Drawing.Point(83, 4)
               Me.rsPDE2.Size = New System.Drawing.Size(15, 35)

               Me.rsPIE2.Location = New System.Drawing.Point(5, 4)
               Me.rsPIE2.Size = New System.Drawing.Size(15, 35)

               Me.rsPDI2.Location = New System.Drawing.Point(64, 4)
               Me.rsPDI2.Size = New System.Drawing.Size(15, 35)

               Me.ShapeContainer10.Size = New System.Drawing.Size(102, 44)
               '' 3 /*****************************************************************/
               Me.pnlPos3.Location = New System.Drawing.Point(4, 151)
               Me.pnlPos3.Size = New System.Drawing.Size(102, 44)

               Me.rsPII3.Location = New System.Drawing.Point(25, 4)
               Me.rsPII3.Size = New System.Drawing.Size(15, 35)

               Me.rsPDE3.Location = New System.Drawing.Point(83, 4)
               Me.rsPDE3.Size = New System.Drawing.Size(15, 35)

               Me.rsPIE3.Location = New System.Drawing.Point(5, 4)
               Me.rsPIE3.Size = New System.Drawing.Size(15, 35)

               Me.rsPDI3.Location = New System.Drawing.Point(64, 4)
               Me.rsPDI3.Size = New System.Drawing.Size(15, 35)

               Me.ShapeContainer11.Size = New System.Drawing.Size(102, 44)
               '' 4 /*****************************************************************/
               Me.pnlPos4.Location = New System.Drawing.Point(4, 201)
               Me.pnlPos4.Size = New System.Drawing.Size(102, 44)

               Me.rsPII4.Location = New System.Drawing.Point(25, 4)
               Me.rsPII4.Size = New System.Drawing.Size(15, 35)

               Me.rsPDE4.Location = New System.Drawing.Point(83, 4)
               Me.rsPDE4.Size = New System.Drawing.Size(15, 35)

               Me.rsPIE4.Location = New System.Drawing.Point(5, 4)
               Me.rsPIE4.Size = New System.Drawing.Size(15, 35)

               Me.rsPDI4.Location = New System.Drawing.Point(64, 4)
               Me.rsPDI4.Size = New System.Drawing.Size(15, 35)

               Me.ShapeContainer12.Size = New System.Drawing.Size(102, 44)

               Me.pnlVehiculo.Size = New System.Drawing.Size(109, 250)
               Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
               Me.Size = New System.Drawing.Size(109, 250)
               Me.MaximumSize = New System.Drawing.Size(109, 250)
               Me.MinimumSize = New System.Drawing.Size(109, 250)
         End Select
         Me.pnlVehiculo.ResumeLayout(False)
         Me.pnlPos4.ResumeLayout(False)
         Me.pnlPos3.ResumeLayout(False)
         Me.pnlPos2.ResumeLayout(False)
         Me.pnlPos1.ResumeLayout(False)
         Me.ResumeLayout(False)
      Catch ex As Exception
         Throw ex
      End Try
   End Sub
#End Region

#Region " Metodos de Controles"

#End Region

End Class
